package quizSuggestion

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method 'POST'
        url '/api/v2/suggestions'
        headers {
            contentType(applicationJsonUtf8())
            header('id', 1)
        }
        body("""
            {
                "studentId": 1,
                "content": "content",
                "assignmentId": 1,
                "quizId": 1,
            }
        """)
        bodyMatchers {
            jsonPath('$.studentId',byRegex(number()))
            jsonPath('$.content',byRegex(nonEmpty()))
            jsonPath('$.assignmentId',byRegex(number()))
            jsonPath('$.quizId',byRegex(number()))
        }
    }
    response {
        status 201
        headers {
            contentType(applicationJsonUtf8())
        }
    }
}